<template>
  <el-input clearable v-model="data.form[data.attr.prop]" v-bind="data.attr" />
</template>
<script lang="ts">
import { defineComponent, reactive, toRefs, onMounted, ref } from 'vue'
import { initState } from '@/components/tableSearch/component/index'
export default defineComponent({
  name: 'DateTime',
  setup(props, ctx) {
    const attrs = ctx.attrs
    const state = reactive<any>({
      data: {
        attr: {},
        form: {}
      }
    })
    onMounted(() => {
      state.data = initState(attrs)
    })
    return {
      ...toRefs(state)
    }
  }
})
</script>
<style lang="scss" scoped>
:deep(.el-date-editor) {
  width: 100% !important;
}
:deep(.el-input--small .el-input__prefix) {
  left: 0 !important;
}
</style>
